package com.chenshu.lifecycle;

import com.chenshu.lifecycle.beanlife.BeanLifeComponent;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-04
 * Time：21:55
 */
public class Application {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("bean-lifecycle.xml");
        BeanLifeComponent beanLifeComponent =
                context.getBean("beanLifeComponent", BeanLifeComponent.class);
        beanLifeComponent.use();
        context.destroy();
    }
}
